Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## rdlc.commands
Class Command

    java.lang.Object
      java.lang.Thread
          rdlc.commands.Command

All Implemented Interfaces:
  java.lang.Runnable

Direct Known Subclasses:
  Check, GUI, Map, Shell

    public abstract class Command

extends java.lang.Thread

This class provides and abstract base for the RDLC command classes. Each command class can perform exactly one RDLC generation command (eg shell or map), and extends the thread class so that it can do so in an independant thread. This class constains storage for all of the universally useful command information, eg input and output paths, files, etc.

Version:
  $Revision: 1.18 $
Author:
  Greg Gibeling

Nested Class Summary

Nested classes/interfaces inherited from class java.lang.Thread
`java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler`

Field Summary
`protected java.lang.String[]` | `commandOptions` The array of string options specific to this command.
`protected Log` | `errorLog` A running log of all of the error messages created during project read in.
`protected java.lang.Class` | `inputClass` The class relative to which resources should be loaded.
`protected java.lang.String` | `inputFileName` The RDL input file.
`protected java.io.File` | `inputPath` The input path.
`protected java.util.List<java.io.File>` | `manifest` A running manifest of all the files generated by this command.
`protected java.io.PrintStream` | `oldErr` The original standard error stream;
`protected Catalog<java.lang.String,java.lang.String>` | `options` A catalog of RDLC global command line options.
`protected java.io.File` | `outputPath` The output path.
`protected static java.util.Hashtable<java.lang.String,java.lang.String>` | `pluginConfigTable` Table of the plugin specific configuration strings.
`protected Catalog<java.lang.String,Plugin>` | `plugins` Catalog of the plugins to be finished when the command is complete.
`protected static java.util.Hashtable<java.lang.String,java.lang.Class>` | `pluginTable` Table of the plugin specific command classes.
`protected Namespace` | `root` The root namespace of the command.

Fields inherited from class java.lang.Thread
`MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY`

Constructor Summary
`Command(Main main, java.lang.String _inputFileName, java.lang.Class _inputClass, Catalog<java.lang.String,java.lang.String> _options, java.lang.String[] _commandOptions)` Default constructor, saves all of the given parameters.

Method Summary
`void` | `backEndPlugin(PluginField pluginField)` Invoke the named plugin for the given RDL instance and argument.
`protected void` | `end()` End the current project.
`void` | `frontEndPlugins(Instance instance, boolean recursive)` Find and invoke all front end plugins in the given instance.
`java.lang.String` | `getCommandName()` Simple accessor.
`Log` | `getErrorLog()` Simple accessor.
`java.lang.Class` | `getInputClass()` Simple accessor.
`java.io.File` | `getInputPath()` Simple accessor.
`abstract java.lang.String` | `getLanguage()` Simple accessor.
`java.util.List<java.io.File>` | `getManifest()` Simple accessor.
`java.lang.String` | `getOption(java.lang.String option)` Get the value for the given option name.
`java.io.File` | `getOutputPath()` Simple accessor.
`boolean` | `hasErrors(boolean reportPlugin)` Returns true if this command had any errors during the read-in process.
`abstract boolean` | `invoke()` Run the actual project generation.
`void` | `run()` Thread run method.
`protected boolean` | `start(java.lang.String name)` Start the RDL front end project.

Methods inherited from class java.lang.Thread
`activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### inputPath

    protected java.io.File inputPath

  The input path.

### inputClass

    protected java.lang.Class inputClass

  The class relative to which resources should be loaded.

### inputFileName

    protected java.lang.String inputFileName

  The RDL input file.

### outputPath

    protected java.io.File outputPath

  The output path.

### manifest

    protected java.util.List<java.io.File> manifest

  A running manifest of all the files generated by this command. The first entry will be the path of the root namespace of the output.

### errorLog

    protected Log errorLog

  A running log of all of the error messages created during project read in.

### root

    protected Namespace root

  The root namespace of the command.

### options

    protected Catalog<java.lang.String,java.lang.String> options

  A catalog of RDLC global command line options.

### commandOptions

    protected java.lang.String[] commandOptions

  The array of string options specific to this command.

### pluginTable

    protected static java.util.Hashtable<java.lang.String,java.lang.Class> pluginTable

  Table of the plugin specific command classes.

### pluginConfigTable

    protected static java.util.Hashtable<java.lang.String,java.lang.String> pluginConfigTable

  Table of the plugin specific configuration strings.

### plugins

    protected Catalog<java.lang.String,Plugin> plugins

  Catalog of the plugins to be finished when the command is complete.

### oldErr

    protected java.io.PrintStream oldErr

  The original standard error stream;

Constructor Detail

### Command

    public Command(Main main,
                   java.lang.String _inputFileName,
                   java.lang.Class _inputClass,
                   Catalog<java.lang.String,java.lang.String> _options,
                   java.lang.String[] _commandOptions)

  Default constructor, saves all of the given parameters.

  Parameters:
    `main` - The main object which is invoking this command.
    `_inputFileName` - The input RDL source file for this command.
    `_inputClass` - The class relative to which resources should be loaded.
    `_options` - Catalog of RDLC global command line options.
    `_commandOptions` - Array of options specific to this command.

Method Detail

### run

    public void run()

  Thread run method. Simple invokes this command and ignores the error flag that invoke returns.

  Specified by:
    `run` in interface `java.lang.Runnable`
  Overrides:
    `run` in class `java.lang.Thread`
  See Also:
    `invoke()`

### start

    protected boolean start(java.lang.String name)

  Start the RDL front end project.

  Parameters:
    `name` - The name to use for the root namespace.
  Returns:
    `true` on success.

### hasErrors

    public boolean hasErrors(boolean reportPlugin)

  Returns true if this command had any errors during the read-in process. If this returns true, you should also call `emitErrorList()` to report the errors to the user for correction.

  Parameters:
    `reportPlugin` - Should plugin errors result in this method returning `true`?
  Returns:
    `true` if there were any errors during read-in.

### end

    protected void end()

  End the current project. This is the cleanup call which will close all of the appropriate files and reset the error redirection.

### getOption

    public java.lang.String getOption(java.lang.String option)

  Get the value for the given option name.

  Parameters:
    `option` - The name of the option.
  Returns:
    The value of the option.

### getErrorLog

    public Log getErrorLog()

  Simple accessor.

  Returns:
    A log of errors to be reported to the user.

### getOutputPath

    public java.io.File getOutputPath()

  Simple accessor.

  Returns:
    Return the output path.

### getInputPath

    public java.io.File getInputPath()

  Simple accessor.

  Returns:
    Return the input path.

### getInputClass

    public java.lang.Class getInputClass()

  Simple accessor.

  Returns:
    Return the input class.

### getManifest

    public java.util.List<java.io.File> getManifest()

  Simple accessor.

  Returns:
    A manifest of all the file generated by this command.

### getCommandName

    public java.lang.String getCommandName()

  Simple accessor.

  Returns:
    The name of the root of this command.

### invoke

    public abstract boolean invoke()

  Run the actual project generation. This is separated so that the actual project generation can be run in a different thread from the GUI. Notice that the command code is not placed directly in the run method, as the command line interface needs to know if there were errors during execution.

  Returns:
    `true` on success.
  See Also:
    `run()`

### getLanguage

    public abstract java.lang.String getLanguage()

  Simple accessor.

  Returns:
    Get the name of the output language.

### backEndPlugin

    public void backEndPlugin(PluginField pluginField)

  Invoke the named plugin for the given RDL instance and argument. This may require the plugin to be loaded.

  Parameters:
    `pluginField` - The RDL plugin field being invoked.

### frontEndPlugins

    public void frontEndPlugins(Instance instance,
                                boolean recursive)

  Find and invoke all front end plugins in the given instance.

  Parameters:
    `instance` - The instance in which to find and invoke plugins.
    `recursive` - Should this function call itself on sub-instances.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD